/**
 * 
 */
package org.ssssssss.magicapi;

import java.nio.ByteOrder;
import java.text.SimpleDateFormat;

import org.ssssssss.magicapi.core.service.MagicAPIService;
import org.ssssssss.magicapi.mqtt.MqttServerStarter;

/**
 * @author 
 *
 */
public class Const {
	/**
	 * 用于群聊的group id
	 */
	public static final String GROUP_ID = "r2r-websocket";
	
	public static final String CHARSET = "utf-8";//"utf-8";//"ascii";//
	
	public static final ByteOrder byteOrder = ByteOrder.LITTLE_ENDIAN;//.BIG_ENDIAN;

	public static SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
	
	// 通过magic-api处理数据的接口定义
	public static String MQTT_MESSAGE_API = "/platform/network/mqtt/messageApi";
	public static String SOCKET_DEBUG_DATA_API = "/platform/network/revDebugData";
	public static String WS_BYTE_API = "/platform/network/ws/byteApi";
	public static String WS_TEXT_API = "/platform/network/ws/textApi";
	public static String WS_CLOSE_API = "/platform/network/ws/closeApi";
	
	
	private static MagicAPIService service;
	
	public static void setService(MagicAPIService service) {
		Const.service = service;
	}
	public static MagicAPIService getService() {
		return service;
	}
	public static void setMqttApi(String messageApi) {
		Const.MQTT_MESSAGE_API = messageApi;
	}
	public static void setWsApi(String byteApi,String textApi,String closeApi) {
		Const.WS_BYTE_API = byteApi;
		Const.WS_TEXT_API = textApi;
		Const.WS_CLOSE_API = closeApi;
	}
}
